<?php

/*
 * @author 704993132@qq.com
 * @function 加载导航网站首页
 */

class SecondPageAction extends CommonAction {

    /**
     * 加载左侧大分类导航栏
     */
    public function loadCategory() {
        $level = 1;
        $gw_category = M('Gw_category');
        $map['level'] = array('eq', $level);
        $categoryFirstArray = $gw_category->where($map)->select();
        $this->assign('categoryFirstArray', $categoryFirstArray);
        $this->display();
    }

    /**
     * 加载子类下面的品牌
     */
    public function loadSecondCategoryBrand($secondCategoryId) {

        $categoryId = $this->_get('categoryId');
        $categoryBrand = D('CategoryBrandView');
        $where['bc.categoryId'] = $categoryId;
        $cList = $categoryBrand->where($where)->select();
        $count = $cList->count();
        import('ORG.Util.Page'); // 导入分页类        
        $Page = new Page($count, 10); // 实例化分页类 传入总记录数和每页显示的记录数
        $show = $Page->show(); // 分页显示输出
        $this->assign('cList', $cList);
        $this->assign('page', $show); // 赋值分页输出
        $this->assign('count', $count);
        $this->display();
    }

}

?>
